import {Module} from '@nestjs/common';
import {TypeOrmModule} from "@nestjs/typeorm";
import {mysqlDatabase, mysqlPort, mysqlUser, mysqlPassword, mysqlHost} from "@/conf/dbConf";
import {entitys} from "@/entitys/entitys";

@Module({
    imports: [
        TypeOrmModule.forRoot({
            type: 'mysql',
            host: mysqlHost,
            port: mysqlPort,
            username: mysqlUser,
            password: mysqlPassword,
            database: mysqlDatabase,
            entities: entitys,
            // entities: ["dist/entitys/**/*.entity.js"],
            // entities: ["dist/entitys/resources/*.entity.js"],
            synchronize: true,
            // logging: true
        })
    ],
    providers: [],
})
export class DBModule {}